﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using LosConn.Common;

namespace LosConn.Web.Data
{
    public partial class DataCheckConfirmAudit : BasePage.AdminBasePage
    {
        public Model.Los_Guest modelGuest = new Model.Los_Guest();
        public Model.Los_Guest modelCheck = new Model.Los_Guest();
        public Model.Los_Guest modelEyeCheck = new Model.Los_Guest();
        public Model.Los_Guest modelRetinaCheck = new Model.Los_Guest();
        public String html = String.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                modelGuest.Guest_ID = Convert.ToInt32(Request["id"]);
                BLL.Los_Guest bllGuest = new BLL.Los_Guest();
                modelGuest = bllGuest.GetGuestModel(modelGuest);
                //if (!String.IsNullOrEmpty(modelGuest.Guest_Birthday.ToString()))
                //{
                //    modelGuest.Guest_Birthday = Convert.ToDateTime(Convert.ToDateTime(modelGuest.Guest_Birthday).ToString("yyyy-MM-dd"));
                //}
                modelCheck = bllGuest.GetCheckModel(modelGuest);
                modelEyeCheck = bllGuest.GetEyeCheckModel(modelGuest);
                modelRetinaCheck = bllGuest.GetRetinaCheckModel(modelGuest);

                BLL.Los_Question bllQue = new BLL.Los_Question();
                DataTable dt = bllQue.GetQueAnsList(String.Format(" QueAns_GuestID={0} and QueAns_Status=100 ", modelGuest.Guest_ID)).Tables[0];
                StringBuilder sb = new StringBuilder(1000);
                Int32 idx = 0;
                if (dt != null && dt.Rows.Count > 0)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        idx++;
                        sb.Append("<p class=\"amount-word\">");
                        sb.AppendFormat("{0}、{1}： <span>{2}</span>", idx, dr["QueAns_QuestionName"], dr["QueAns_AnswerName"]);
                        sb.Append("</p>");
                    }
                }
                html = sb.ToString();
            }
        }
    }
}